#Symbolic reference is defined as follows.
#When perl see $$var, if $var is not a hard referce, then perl checks to see if $var contains a string.
#If so, perl uses that string as a regular variable name, and operations on that variable.

$x = 10;
$var = "x";
$$var = 30; #$var is symbolic reference, since $var is not a hard reference, and its value is "x", which
#is a variable name.

print "x=", $x, "\n";

#It is important to note that symbolic references work only for global variables, not for those
# marked private using my.
my $num = 100;
my $varNum = "num";
${$varNum} = 200;
$$varNum = 300;
print "num=", $num, "\n";


#We can Tell Perl not to allow symbolic references as follows:
use strict 'refs';  # Tell Perl not to allow symbolic references
$y = 20;
$var1 = "y";
$$var1 = 30;